11.2 新增用户目录

基本信息

Path: /api/v1/userDirectory/create

Method: POST

接口描述:

  1. 新建认证服务区分多种类型,config包含各种服务器的具体配置

请求参数

Body

名称 类型 是否必须 默认值 备注 其他信息
name string 必须 用户目录名称
domain string 必须 唯一标识
config object 必须 用户目录配置
type string 必须 用户目录类型 示例:ldap
description string 非必须 描述
resourceGroupIdList string[] 非必须 应用分类ID列表
resourceIdList string[] 非必须 应用ID列表  

说明:

  • config不同种类的用户目录,配置字段不相同,具体参见json字段

请求示例

{
    "name": "test",
    "domain": "test",
    "description": "",
    "type": "ldap",
    "config": {
        "type": "ad",
        "syncConfig": {
            "syncTime": {
                "period": 86400000
            },
            "cleanDeleted": {
                "enable": 1,
                "interval": 168
            }
        },
        "templateId": "3b52d0e4-e178-4bef-aef2-95eaf91adeeb",
        "interfaceStatus": 1,
        "externalUserServerConfig": {
            "type": "ad",
            "pwdModel": "clear",
            "serverIp": "192.168.1.2",
            "directory": {
                "type": "ldap",
                "subtype": "default"
            },
            "bandFilter": "(&(CN=*)&(ObjectClass=group))",
            "reqTimeout": "15",
            "userFilter": "(objectCategory=person)",
            "groupFilter": "(ou=*)",
            "adminAccount": "test@test.com",
            "adminPassword": "gl!@#157",
            "serverAddress": "ldap://192.168.1.2",
            "sAMAccountName": "sAMAccountName",
            "searchEntrance": "OU=dyx,DC=lichee,DC=com",
            "serverProtocol": "ldap://",
            "bandAttrMapping": {
                "name": "cn",
                "externalId": "objectGUID",
                "description": "description"
            },
            "interfaceStatus": 1,
            "userAttrMapping": {
                "name": "uid",
                "band": "memberOf",
                "path": "ou",
                "email": "mail",
                "phone": "telephoneNumber",
                "status": "userAccountControl",
                "externalId": "objectGUID",
                "description": "description",
                "expiredTime": "accountExpires"
            },
            "groupAttrMapping": {
                "name": "ou",
                "externalId": "objectGUID",
                "description": "description"
            }
        },
        "forbidUnimportedUserLogin": 1,
        "unImportedUserAuthOption": {
            "behavior": "default"
        }
    },
    "resourceIdList": [
        "33a3c5c0-a669-11eb-b198-995bae08331f"
    ],
    "resourceGroupIdList": [
        "default"
    ]
}

返回数据

名称 类型 是否必须 默认值 备注 其他信息
code number 必须 错误码,非0表示错误,具体含义请参考错误码定义
data object 必须 返回内容
├─ data string[] 必须 新建的用户目录ID
msg string 必须 描述信息  

返回示例

{
    "code": 0,
    "data": {
        "data": ["fb46aeb0-2351-11ed-bb2f-a34918760294"]
    },
    "msg": "请求成功"
}

错误信息

错误提示 错误码
用户目录类型错误 7201
参数检查出错 10000001
认证服务器不存在 77200004
https认证模板不存在 77200001
方法入参不能为空 10000001
创建失败 10000000
已存在一个%s认证服务器,不可以再创建 77200007
用户目录名%s已存在 77200005
用户目录唯一标识(%s)已存在 77200006
用户最多关联1000个应用 77200007
保存失败,关联的应用不存在或已被删除 77200004
保存失败,关联的应用分类不存在或已被删除 77200004
用户目录不存在 77200001
深信服科技 all right reserved,powered by Gitbook本文档更新于: 2024-05-18 14:38

results matching ""

    No results matching ""